<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<div class="body" style="position: relative">
    <div style="position: absolute;left: 20px;top:10px ; width: 70px; text-align: center;color: #47a6f5;cursor:pointer;border: 1px solid  #47a6f5;line-height: 28px"
         onclick="manage_sys_opens('中心机房','/manage/demo/powerPage/tosecondaryPages.html')">返回</div>
<div class="container"><div class="EMStop1"></div></div>
<div class="container1">
    <div class="EMSUspContent"><p class="EMStitle" style="position: absolute;top:40px ;position: relative">所有设备状态</p>
        <div class="content">
            <div class="left">
                <div class="upsSd" style="background-image: url('/manage/assert/image/kongkai.png');background-size: 60% 100%;">
                    <div class="loading" id="box">
                       
                    </div>
                </div>
                <p>连接状态 :<span class="linkSuccess"></span></p>
            </div>
            <div style="overflow: hidden;width:69% ">
                <div class="right" style="height: 380px; width:calc(100% + 19px);overflow: auto;">
                <table id="equipentAll_table" border="2">
                    <tr>
                        <th>设备名</th>
                        <th>状态</th>
                        <th>设备名</th>
                        <th>状态</th>
                    </tr>
                    <tr>
                        <th  class="blueBg">空调1</th>
                        <td><span name="kt1"  class="linkSuccess"></span></td>
                        <th class="blueBg">空调2</th>
                        <td><span name="kt2"  class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">机房大门人体活动探测器</th>
                        <td><span name="rthd" class="linkSuccess"></span></td>
                        <th class="blueBg">机房大门状态磁感器</th>
                        <td ><span name="mcg" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">2号机柜内烟感探测</th>
                        <td><span name="yg2" class="linkSuccess"></span></td>
                        <th class="blueBg">操作间烟感探测</th>
                        <td><span name="ygcz" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">1号机柜上方烟感探测</th>
                        <td><span name="yg1" class="linkSuccess"></span></td>
                        <th class="blueBg">9号机柜内烟感探测</th>
                        <td><span name="yg9" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">9号机柜上方烟感探测</th>
                        <td><span name="yg9s" class="linkSuccess"></span></td>
                        <th class="blueBg">1号机柜上方温湿度监测</th>
                        <td><span name="yg1s" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">UPS数据采集</th>
                        <td><span name="ups" class="linkSuccess"></span></td>
                        <th class="blueBg">E830数据采集</th>
                        <td><span name="e830" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">新风系统数据采集</th>
                        <td><span name="xfj" class="linkSuccess"></span></td>
                        <th class="blueBg">UPS电量仪数据采集</th>
                        <td><span name="upsdly" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">市电电量仪数据采集</th>
                        <td><span name="sdly" class="linkSuccess"></span></td>
                        <th class="blueBg">AD88数据采集</th>
                        <td><span name="ad88" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">9号机柜上方温湿度监测</th>
                        <td><span name="wsd9" class="linkSuccess"></span></td>
                        <th class="blueBg">4号机柜内温湿度监测</th>
                        <td><span name="wsd4" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">8号机柜内温湿度监测</th>
                        <td><span name="wsd8" class="linkSuccess"></span></td>
                        <th class="blueBg">6号机柜内温湿度监测</th>
                        <td><span name="wsd6" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">操作间温湿度监测</th>
                        <td><span name="wsdcz" class="linkSuccess"></span></td>
                        <th class="blueBg">10号机柜内温湿度监测</th>
                        <td><span name="wsd10" class="linkSuccess"></span></td>
                    </tr>
                    <tr>
                        <th class="blueBg">2号机柜内温湿度监测</th>
                        <td><span name="wsd2" class="linkSuccess"></span></td>
                        <th class="blueBg"></th>
                        <td></td>
                    </tr>

                </table>
                </div>
             </div>
        </div>
    </div>
</div>

</div>
<script>
    $(function () {
        var count = 0;
        var t = setInterval(function () {
            var $redDiv = $("#box").find(".greenBg");
            if(count === 15){
                count=-1;
                $("#box").find('.greenBg').removeClass('greenBg').addClass('white');
                $redDiv=$("#box").find(".first");
                $("#box").find(".last").removeClass("greenBg").addClass("white");
            }
            $redDiv.next().removeClass("white").addClass("greenBg");
            count++;
        }, 1000);

       /* var entity18= $.websocket.kongtiao1all
        if(entity18.equipmentid==$.websocket.kongtiao1){//空调1
            if(!entity18.success){
                $("#equipentAll_table span[name='kt1']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='kt1']").css("background-color","green");;
            }

        }
        var entity17= $.websocket.kongtiao2all
        if(entity17.equipmentid==$.websocket.kongtiao2){//空调2

            if(!entity17.success){
                $("#equipentAll_table span[name='kt2']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='kt2']").css("background-color","green");;
            }

        }
        var entity16= $.websocket.upsall
        if(entity16.equipmentid==$.websocket.ups){//ups状态

            if(!entity16.success){
                $("#equipentAll_table span[name='ups']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='ups']").css("background-color","green");;
            }
        }
        var entity15= $.websocket.ygall
        if(entity15.equipmentid==$.websocket.yg){//控制台烟感


            if(!entity15.success){
                $("#equipentAll_table span[name='yg2']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='yg2']").css("background-color","green");;
            }
        }
        var entity14= $.websocket.yg1all
        if(entity14.equipmentid==$.websocket.yg1){//控制台烟感


            if(!entity14.success){
                $("#equipentAll_table span[name='yg9']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='yg9']").css("background-color","green");;
            }

        }
        var entity13 = $.websocket.yg2all
        if(entity13.equipmentid==$.websocket.yg2){//控制台烟感
            if(!true){
                $("#equipentAll_table span[name='yg9s']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='yg9s']").css("background-color","green");;
            }
        }
        var entity12 = $.websocket.yg3all
        if(entity12.equipmentid==$.websocket.yg3){//控制台烟感
            if(!entity12.success){
                $("#equipentAll_table span[name='ygcz']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='ygcz']").css("background-color","green");;
            }
        }
        var entity11 = $.websocket.yg4all
        if(entity11.equipmentid==$.websocket.yg4){//控制台烟感
            if(!entity11.success){
                $("#equipentAll_table span[name='yg1']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='yg1']").css("background-color","green");;
            }

        }
        var entity10 = $.websocket.hongwaiall
        if(entity10.equipmentid==$.websocket.hongwai){//红外

            if(!entity10.success){
                $("#equipentAll_table span[name='hwgy']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='hwgy']").css("background-color","green");;
            }

        }
        var entity9 = $.websocket.menciall
        if(entity9.equipmentid==$.websocket.menci){//门磁??????

            if(!entity9.success){
                $("#equipentAll_table span[name='menc']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='menc']").css("background-color","green");;
            }
        }
        var entity8 = $.websocket.wenshidu1all
        if(entity8.equipmentid==$.websocket.wenshidu1){//温湿度

            //$.websocket.wenshidu1all=entity

            if(!entity8.success){
                $("#equipentAll_table span[name='yg1s']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='yg1s']").css("background-color","green");;
            }

        }
        var entity7 = $.websocket.wenshidu2all
        if(entity7.equipmentid==$.websocket.wenshidu2){//温湿度


            if(!entity7.success){
                $("#equipentAll_table span[name='wsd4']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsd4']").css("background-color","green");;
            }

        }
        var entity6 = $.websocket.wenshidu3all
        if(entity6.equipmentid==$.websocket.wenshidu3){//温湿度

            //$.websocket.wenshidu3all=entity
            if(!entity6.success){
                $("#equipentAll_table span[name='wsd9']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsd9']").css("background-color","green");;
            }

        }
        var entity5 = $.websocket.wenshidu4all
        if(entity5.equipmentid==$.websocket.wenshidu4){//温湿度

            //$.websocket.wenshidu4all=entity

            if(!entity5.success){
                $("#equipentAll_table span[name='wsd8']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsd8']").css("background-color","green");
            }

        }
        var entity4 = $.websocket.wenshidu5all
        if(entity4.equipmentid==$.websocket.wenshidu5){//温湿度
            if(!entity4.success){
                $("#equipentAll_table span[name='wsd6']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsd6']").css("background-color","green");
            }

        }
        var entity3 = $.websocket.wenshidu6all
        if(entity3.equipmentid==$.websocket.wenshidu6){//温湿度

            if(!entity3.success){
                $("#equipentAll_table span[name='wsdcz']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsdcz']").css("background-color","green");;
            }

        }
        var entity2 = $.websocket.wenshidu7all
        if(entity2.equipmentid==$.websocket.wenshidu7){//温湿度
            if(!entity2.success){
                $("#equipentAll_table span[name='wsd10']").css("background-color","red");
            }else {
                $("#equipentAll_table span[name='wsd10']").css("background-color","green");;
            }

        }
        var entity1 = $.websocket.wenshidu8all
        if(entity1.equipmentid==$.websocket.wenshidu8){//温湿度
            if(!entity1.success){
                $("#accessControl_table span[name='wsd2']").css("background-color","red");
            }else {
                $("#accessControl_table span[name='wsd2']").css("background-color","green");;
            }

        }*/


    });
</script>